raar.agent.process.sensor
Class RALightSensor

java.lang.Object
  extended by raar.agent.process.RAProcess
      extended by raar.agent.process.sensor.RASensor
          extended by raar.agent.process.sensor.RALightSensor
All Implemented Interfaces:
java.io.Serializable, RAAgentDependentProcess, RAWorldDependentProcess, RASensorUserSelectable

public class RALightSensor
extends RASensor
implements RAWorldDependentProcess, RASensorUserSelectable

Light sensor can detect a light source in the world.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class raar.agent.process.sensor.RASensor
agent, output, outputName
 
Fields inherited from class raar.agent.process.RAProcess
hasRun, inregister, outregister, register, sourceCode, statement
 
Fields inherited from interface raar.agent.process.RAWorldDependentProcess
NO_OBJECT_DEFINED
 
Fields inherited from interface raar.agent.process.RAAgentDependentProcess
NO_AGENT_DEFINED
 
Constructor Summary
RALightSensor()
          Default constructor.
RALightSensor(RAAgent agent)
          Construct.
 
Method Summary
 java.lang.String explain()
          Provide a description of the sensor.
 java.awt.Color getColor()
          Get color.
 java.lang.String getLightSource()
          Get light source the sensor responds to.
 java.lang.String getProcessableName()
          Return the name of the object/class that this sensor can see.
 boolean isProcessable(RAWorldObject obj)
          Return whether the object given can be seen by the sensor, with the current settings.
 boolean isSuitable(RAWorldObject obj)
          Return whether the object given can be seen by the sensor, independent of any settings.
 void run()
          Run the sensor.
 void setLightSource(java.lang.String lightSource)
          Set light source the sensor responds to.
 void setProcessableName(java.lang.String name)
          Set the name of the object/class that this sensor can see.
 java.lang.String toString()
          String representation.
 boolean usesClasses()
          Return whether the sensor perceives classes (true) or specific objects (false).
 
Methods inherited from class raar.agent.process.sensor.RASensor
acceptsInput, dumpRegisters, execute, get, getAgent, getDataType, getInputNames, getInputObjects, getOutputNames, getOutputObjects, getSensorValue, isSpecial, removeReferenceToAgent, set, setAgent, setOutput, setReferenceToAgent, setSourceCode, suppliesOutput
 
Methods inherited from class raar.agent.process.RAProcess
clone, getProcessName, getSourceCode, reset, setProcessName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RALightSensor

public RALightSensor()
Default constructor.


RALightSensor

public RALightSensor(RAAgent agent)
Construct.

Method Detail

setLightSource

public void setLightSource(java.lang.String lightSource)
Set light source the sensor responds to.


getLightSource

public java.lang.String getLightSource()
Get light source the sensor responds to.


getColor

public java.awt.Color getColor()
Get color.

Overrides:
getColor in class RASensor

run

public void run()
         throws RAException
Run the sensor.

Specified by:
run in class RASensor
Throws:
RAException

toString

public java.lang.String toString()
String representation.

Specified by:
toString in class RASensor

explain

public java.lang.String explain()
Provide a description of the sensor.

Specified by:
explain in class RASensor

isSuitable

public boolean isSuitable(RAWorldObject obj)
Return whether the object given can be seen by the sensor, independent of any settings.

Specified by:
isSuitable in interface RAWorldDependentProcess

isProcessable

public boolean isProcessable(RAWorldObject obj)
Return whether the object given can be seen by the sensor, with the current settings.

Specified by:
isProcessable in interface RAWorldDependentProcess

usesClasses

public boolean usesClasses()
Return whether the sensor perceives classes (true) or specific objects (false).

Specified by:
usesClasses in interface RAWorldDependentProcess

getProcessableName

public java.lang.String getProcessableName()
Return the name of the object/class that this sensor can see.

Specified by:
getProcessableName in interface RAWorldDependentProcess

setProcessableName

public void setProcessableName(java.lang.String name)
Set the name of the object/class that this sensor can see.

Specified by:
setProcessableName in interface RAWorldDependentProcess